﻿using Jesai.DynamicDataSource.Sqlsugar.DbConn;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Jesai.DynamicDataSource.Sqlsugar.DynamicDatasources
{
    public interface IDbProvider
    {
        public SqlSugarScope DB { get; }

        public Task InitDataSourceAsync(List<DBConnection> connections);

        public Task<SqlSugarProvider> GetConnection(string connectionName);

        public Task<SqlSugarScopeProvider> GetConnectionThreadSafe(string connectionName);

        public Task AddConnection(DBConnection connection);

        public Task RemoveConnection(string connectionName);
    }
}
